package com.blog.cloud.auth.oauth.request;

import com.blog.cloud.auth.oauth.enums.AuthResponseStatus;
import com.blog.cloud.auth.oauth.exception.AuthException;
import com.blog.cloud.auth.oauth.model.AuthCallback;
import com.blog.cloud.auth.oauth.model.AuthResponse;
import com.blog.cloud.auth.oauth.model.AuthToken;

public interface AuthRequest {
    /* 授权 */
    default String authorize(String state) {
        throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
    }

    /* 登录 */
    default AuthResponse<Object> login(AuthCallback authCallback) {
        throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
    }

    /* 登出 */
    default AuthResponse<Object> logout(AuthToken authToken) {
        throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
    }

    /* 撤销授权 */
    default AuthResponse<Object> revoke(AuthToken authToken) {
        throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
    }

    /* 刷新 */
    default AuthResponse<Object> refresh(AuthToken authToken) {
        throw new AuthException(AuthResponseStatus.NOT_IMPLEMENTED);
    }
}
